package com.int_tech.data.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by liubch on 2018/6/9.
 */
@Entity
@Table(name = "h_data")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class DataInfo {
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(length = 8)
        private Integer id;

        //贞头
        @Column(length = 64)
        private String zhenTou;

        //设备id
        @Column(length = 64)
        private String shebeiId;

        //数据
        @Column(length = 1024)
        private String dataString;

        //创建时间
        @Temporal(TemporalType.TIMESTAMP)
        @Column(updatable = false)
        private Date createTime;

        //修改时间
        @Temporal(TemporalType.TIMESTAMP)
        private Date updateTime;

        //状态(0，初始状态；1，验证设备id；2，验证温度；3，验证湿度；4，验证坐标；5，验证震动x；6，验证震动y；7，验证震动z)
        @Column(length = 4)
        private int status;

}
